<div ng-controller="SettingCtrl" class="app-ctrl">
    <div class="bg-light lter b-b wrapper-md app-title-fixed">
        <div class="row">
            <div class="col-sm-6 col-xs-6">
                <h1 class="m-n font-thin h3">系统设置</h1>
            </div>
            <div class="col-sm-6 col-xs-6" style="text-align: right;">
                <button class="btn btn-primary"
                        ng-disabled="securitySettingForm.$invalid || !securitySettingForm.$dirty"
                        ng-click="save()">保存
                </button>
                <button class="btn btn-default"
                        ng-disabled="!securitySettingForm.$dirty" ng-click="reset()">重置
                </button>
            </div>
        </div>
    </div>
    <div class="wrapper-md app-inner">
        <form name="securitySettingForm" class="form-horizontal form-property" method="get">
            <div class="panel panel-default">
                <div class="panel-heading font-bold">登录设置</div>
                <div class="panel-body">
                    <div class="form-group">
                        <label class="col-sm-5 control-label">登录失败次数限制</label>
                        <div class="col-sm-7">
                            <input type="number" ng-model='setting.loginFailLimit'
                                   min="3" class="form-control" style="width: 100px"> <span
                                class="help-block m-b-none">登录失败次数超过设置次数则禁止登录并锁定账户，用户登录成功后清除失败次数</span>
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg "></div>
                    <div class="form-group">
                        <label class="col-sm-5 control-label">是否需要输入验证码</label>
                        <div class="col-sm-7">
                            <label class="i-switch bg-primary m-t-xs m-r"> <input
                                    type="checkbox" ng-checked="setting.showCaptcha"
                                    ng-model="setting.showCaptcha"> <i></i>
                            </label>
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg " ng-show='setting.showCaptcha'></div>
                    <div class="form-group fade-in" ng-show='setting.showCaptcha'>
                        <label class="col-sm-5 control-label">只在异常登录情况下输入</label>
                        <div class="col-sm-7">
                            <label class="i-switch bg-primary m-t-xs m-r"> <input
                                    type="checkbox"
                                    ng-checked="setting.showCaptchaOnError"
                                    ng-model="setting.showCaptchaOnError"> <i></i>
                            </label>
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg " ng-show='setting.showCaptcha'></div>
                    <div class="form-group fade-in" ng-show='setting.showCaptcha'>
                        <label class="col-sm-5 control-label">验证码长度</label>
                        <div class="col-sm-7">
                            <input type="number" min="4" max="8" class="form-control" required style="width: 100px"
                                   ng-model="setting.captchaLength"> <span
                                class="help-block m-b-none">生成验证码长度，最短长度4位，最长为8位</span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading font-bold">密码策略</div>
                <div class="panel-body">
                    <div class="form-group">
                        <label class="col-sm-5 control-label">默认密码</label>
                        <div class="col-sm-7">
                            <input type="text" ng-minLength="4" maxlength="20" class="form-control"
                                   style="width: 150px"
                                   ng-model="setting.defaultPassword"> <span
                                class="help-block m-b-none">控制台添加用户默认的密码，用户第一次登录需要修改密码，最短4位，最长20位</span>
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg "></div>
                    <div class="form-group">
                        <label class="col-sm-5 control-label">密码长度</label>
                        <div class="col-sm-7">
                            <input type="number" min="4" class="form-control"
                                   style="width: 100px"
                                   ng-model="setting.minLengthOfPassword"> <span
                                class="help-block m-b-none">限制用户密码的最短长度，最短长度4位</span>
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg "></div>
                    <div class="form-group">
                        <label class="col-sm-5 control-label">密码强度</label>
                        <div class="col-sm-7">
                            <label class="checkbox-inline i-checks">
                                <input type="radio" name="passwordStrength" value="1"
                                       ng-checked="setting.passwordStrength == 1"
                                       ng-model="setting.passwordStrength"><i></i>
                                弱
                            </label>
                            <label class="checkbox-inline i-checks">
                                <input type="radio" name="passwordStrength" value="2"
                                       ng-checked="setting.passwordStrength == 2"
                                       ng-model="setting.passwordStrength"><i></i>
                                普通
                            </label>
                            <label class="checkbox-inline i-checks">
                                <input type="radio" name="passwordStrength" value="3"
                                       ng-checked="setting.passwordStrength == 3"
                                       ng-model="setting.passwordStrength"><i></i>
                                中等
                            </label>
                            <label class="checkbox-inline i-checks">
                                <input type="radio" name="passwordStrength" value="4"
                                       ng-checked="setting.passwordStrength == 4"
                                       ng-model="setting.passwordStrength"><i></i>
                                强
                            </label>
                            <div
                                    ng-show="setting.passwordStrength ==1"
                                    class="alert alert-info"
                                    style="margin-bottom: 0px; margin-top: 10px; width: 400px;"
                                    role="alert">任意密码，只要求限制密码长度
                            </div>
                            <div
                                    ng-show="setting.passwordStrength == 2"
                                    class="alert alert-info"
                                    style="margin-bottom: 0px; margin-top: 10px; width: 400px;"
                                    role="alert">密码必须为数字和字母组合
                            </div>
                            <div
                                    ng-show="setting.passwordStrength == 3"
                                    class="alert alert-info"
                                    style="margin-bottom: 0px; margin-top: 10px; width: 400px;"
                                    role="alert">密码必须为数字和字母组合，且必须含有大小写字母
                            </div>
                            <div
                                    ng-show="setting.passwordStrength == 4"
                                    class="alert alert-info"
                                    style="margin-bottom: 0px; margin-top: 10px; width: 400px;"
                                    role="alert">密码必须为数字和字母组合，且必须含有大小写字母和特殊字符
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading font-bold">上传设置</div>
                <div class="panel-body">
                    <div class="form-group">
                        <label class="col-sm-5 control-label">文件大小限制</label>
                        <div class="col-sm-7">
                            <input type="number" ng-model="setting.maxUploadFileSize"
                                   min="0" class="form-control"
                                   style="width: 100px; display: inline;"/> MB
                            <div
                                    ng-show="(setting.maxUploadFileSize > 2048)"
                                    class="alert alert-danger"
                                    style="margin-bottom: 0px; margin-top: 5px; width: 200px;"
                                    role="alert">最大限制不能超过2G
                            </div>
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg "></div>
                    <div class="form-group">
                        <label class="col-sm-5 control-label">文件分片大小</label>
                        <div class="col-sm-7">
                            <input type="number" ng-model="setting.multiPartSize"
                                   min="0" class="form-control"
                                   style="width: 100px; display: inline;"/> MB
                            <span class="help-block m-b-none">设置断点续传文件分片大小</span>
                            <div
                                    ng-show="(setting.multiPartSize > 50)"
                                    class="alert alert-danger"
                                    style="margin-bottom: 0px; margin-top: 5px; width: 200px;"
                                    role="alert">最大限制不能超过50MB
                            </div>
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg "></div>
                    <div class="form-group">
                        <label class="col-sm-5 control-label">允许上传的文件后缀</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" style="width: 300px"
                                   ng-model="setting.includeExtensions">
                            <span class="help-block m-b-none">填写文件后缀，多个后缀使用“;”进行连接，例如：doc;docx;xls</span>
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg "></div>
                    <div class="form-group">
                        <label class="col-sm-5 control-label">禁止上传的文件后缀</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" style="width: 300px"
                                   ng-model="setting.excludeExtensions"> <span
                                class="help-block m-b-none">填写文件后缀，多个后缀使用“;”进行连接，例如:exe;bat</span>
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg "></div>
                    <div class="form-group">
                        <label class="col-sm-5 control-label">允许上传的文件类型</label>
                        <div class="col-sm-7">
                            <textarea rows="6" class="form-control" style="width: 300px"
                                      ng-model="setting.includeContentTypes">
                            </textarea>
                            <span class="help-block m-b-none">填写文件类型，多个类型请换行填写</span>
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg "></div>
                    <div class="form-group">
                        <label class="col-sm-5 control-label">禁止上传的文件类型</label>
                        <div class="col-sm-7">
                            <textarea rows="6" class="form-control" style="width: 300px"
                                      ng-model="setting.excludeContentTypes">
                            </textarea>
                            <span class="help-block m-b-none">填写文件类型，多个类型请换行填写</span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading font-bold">文件设置</div>
                <div class="panel-body">
                    <!--					<div class="form-group">
                                            <label class="col-sm-5 control-label">文件加密存储</label>
                                            <div class="col-sm-7">
                                                <label class="i-switch bg-primary m-t-xs m-r"> <input
                                                    type="checkbox" ng-checked="setting.enableEncrypt"
                                                    ng-model="setting.enableEncrypt"> <i></i>
                                                </label>
                                            </div>
                                        </div>
                                         <div class="line line-dashed b-b line-lg " ng-show="setting.enableEncrypt"></div>
                                        <div class="form-group"
                                            ng-show="setting.enableEncrypt">
                                            <label class="col-sm-5 control-label">加密密钥</label>
                                            <div class="col-sm-7">
                                                <input type="text" class="form-control" style="width: 200px">
                                                <span class="help-block m-b-none">用于加密文件的密钥，如果密钥设置则将为每个文件随机生成密钥</span>
                                            </div>
                                        </div>
                                        <div class="line line-dashed b-b line-lg "></div> -->
                    <div class="form-group">
                        <label class="col-sm-5 control-label">开启水印</label>
                        <div class="col-sm-7">
                            <label class="i-switch bg-primary m-t-xs m-r"> <input
                                    type="checkbox" ng-checked="setting.enableWatermark"
                                    ng-model="setting.enableWatermark"> <i></i>
                            </label>
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg hidden" ng-show="setting.enableWatermark"></div>
                    <div class="form-group " ng-show="setting.enableWatermark">
                        <label class="col-sm-5 control-label">水印内容</label>
                        <div class="col-sm-7">
                            <label class="checkbox-inline i-checks"> <input
                                    type="checkbox" ng-checked="watermarkProperties.name"
                                    ng-model="watermarkProperties.name"><i></i> 姓名
                            </label> <label class="checkbox-inline i-checks"> <input
                                type="checkbox" ng-checked="watermarkProperties.dept"
                                ng-model="watermarkProperties.dept"><i></i> 部门
                        </label> <label class="checkbox-inline i-checks"> <input
                                type="checkbox" ng-checked="watermarkProperties.date"
                                ng-model="watermarkProperties.date"><i></i> 日期
                        </label> <label class="checkbox-inline i-checks"> <input
                                type="checkbox" ng-checked="watermarkProperties.time"
                                ng-model="watermarkProperties.time"><i></i> 时间
                        </label> <label class="checkbox-inline i-checks"> <input
                                type="checkbox" ng-checked="watermarkProperties.fileName"
                                ng-model="watermarkProperties.fileName"><i></i>
                            文件名称
                        </label>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>